package com.me.TextMissed_a1;


import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
import android.util.Log;

public class AppWidgetConfigure extends Activity {

	static final String TAG = "AppWidgetConfigure";
	private static final String PREFS_NAME  = "TextMissed_a1";
	
	public static final String DEFAULT_WAKE_INTERVAL = "5s";
	 

    // Read the prefix from the SharedPreferences object for this widget.
    // If there is no preference saved, get the default from a resource
    static String loadTitlePref(Context context, int appWidgetId) {
        SharedPreferences prefs = context.getSharedPreferences(PREFS_NAME, 0);        
        Log.d("_TextMissed_a1_", "AppWidgetConfigure locale_pref: "+prefs.getString("locale_pref",null));
        return prefs.getString("locale_pref",null);        
    }
    
    static Boolean loadNoneAlternative (Context context, int appWidgetId){
    	SharedPreferences prefs = context.getSharedPreferences(PREFS_NAME, 0);        
        return prefs.getBoolean("noneAlternative",false);
    }
    
    static String[] getParameters(Context context, int appWidgetId) {
    	String parameters[] = {"", "", "", "", "","","","","","","","","",""}; 
    	//test1[] ="0"; enableMsg
    	SharedPreferences prefs = context.getSharedPreferences(PREFS_NAME, 0);
    	Boolean noneAlternative = prefs.getBoolean("noneAlternative",false);
    	Boolean enableMsg = prefs.getBoolean("enableMsg",false);
    	String locale_pref = prefs.getString("locale_pref",null);
    	String sizeMsg = Integer.toString(prefs.getInt("sizeMsg",10));
    	String sizeMsgNumber = Integer.toString(prefs.getInt("sizeMsgNumber",12));
    	String keyColorMsg =  prefs.getString("keyColorMsg",null);
    	String keyColorMsgNumber =  prefs.getString("keyColorMsgNumber",null);
    	String keyColorMsgNumberNonZero =  prefs.getString("keyColorMsgNumberNonZero",null);
    	//String sizePhn = Integer.toString(prefs.getInt("sizePhn",10));
    	Boolean enablePhn  = prefs.getBoolean("enablePhn",false);
    	String keyColorPhn =  prefs.getString("keyColorPhn",null);
    	String keyColorPhnNumber =  prefs.getString("keyColorPhnNumber",null);
    	String keyColorPhnNumberNonZero =  prefs.getString("keyColorPhnNumberNonZero",null);
    	parameters[0] = noneAlternative.toString();    	
    	parameters[1] = enableMsg.toString();
    	parameters[2] = locale_pref;
    	parameters[3] = sizeMsg;
    	parameters[4] = sizeMsgNumber;
    	parameters[5] = keyColorMsg;
    	parameters[6] = keyColorMsgNumber;
    	parameters[7] = keyColorMsgNumberNonZero;    	
    	parameters[8] = enablePhn.toString();    	
    	parameters[9] = Integer.toString(prefs.getInt("sizePhn",10));    	
    	parameters[10] = Integer.toString(prefs.getInt("sizePhnNumber",10));    	
    	parameters[11] = keyColorPhn;
    	parameters[12] = keyColorPhnNumber;
    	parameters[13] = keyColorPhnNumberNonZero;
        //Log.d("_TextMissed_a1_", "AppWidgetConfigure keyColorPhnNumber: "+keyColorPhnNumber);
    	return parameters;
    }



}
